<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.List, java.util.ArrayList"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h4>Alice's Wall!</h4>
        <form method="get" action="MyServlet">
            <input type="textbox" name="txtComments" size="25"><p></p>
            <input type="submit" value="Submit">
            <input type="reset" value="Reset">
        <h4>Comment section:</h4>
        <table>
            <tr>
            <%
                List<String> messages = (ArrayList<String>) request.getSession().getAttribute("messages");

                if (messages != null)
                {
                    for (int i=0; i < messages.size(); i++)
                    {
                    %>
                        <%= "<tr><td><h3><font color=blue>" + messages.get(i).toString() + "</font><h3></td></tr>" %>
                    <%
                    }
                }
             %>
             </tr>
        </table>
        </form>
    </body>
</html>
